#include "Block.h"
#include "Map.h"
#include "IO.h"

void Map::show( ) const {
	IO::print( "\n" );
	int lastX = 1;
	int lastY = 0;
	for (const auto & pair : mBlocks) {
		const Block * block = pair.second.get();
		int curX = block->getX( );
		int curY = block->getY( );

		while (lastY < curY) { IO::print( "\n\t" ); ++lastY; lastX = 1; }
		while (lastX < curX) {
			IO::print( "   " );
			++lastX;
		}
		block->draw( );
		lastX = curX + 1;
	}
	IO::print( "\n\n" );
}
